package com.hongdee.crm.tdc.service;

import com.github.pagehelper.PageInfo;
import com.hongdee.crm.tdc.pojo.*;

import java.util.List;

/**
 * @author zhangkai
 * @desc 一句话描述
 **/
public interface IMarketQuestionService {

    /**
     * 分页查询记录
     *
     * @param page
     * @param limit
     * @param pid
     * @return
     * @throws Exception
     */
    PageInfo<MarketQuestionLibraryPojo> page(int page, int limit, String pid, String brandCode) throws Exception;


    /***
     * 新增记录
     * @param po
     * @throws Exception
     */
    void saveOrUpdateLibary(MarketQuestionLibraryPojo po) throws Exception;


    /**
     * 更新状态
     *
     * @param id
     * @param status
     * @throws Exception
     */
    void updateLibaryStatus(String id, String status) throws Exception;

    /***
     * 查询问题树
     * @return
     * @throws Exception
     */
    List<MarketQuestionLibraryPojo> treeLibaray(String pId) throws Exception;

    /**
     * 查询详情
     *
     * @param id
     * @return
     */
    MarketQuestionLibraryPojo info(String id) throws Exception;


    /***************问卷基本接口**********************/

    /**
     * 分页查询记录
     *
     * @param page
     * @param limit
     * @return
     * @throws Exception
     */
    public PageInfo<MarketNairePoJo> pageNaire(int page, int limit, String companyId, String code) throws Exception;

    /***
     * 新增记录
     * @param uid
     * @param map
     * @throws Exception
     */
    MarketNairePoJo saveOrUpdateNarie(String uid, RequestPo reqVo) throws Exception;


    /**
     * 更新状态
     *
     * @param id
     * @param status
     * @throws Exception
     */
    void updateNarireStatus(String id, String status) throws Exception;


    /**
     * 查询详情
     *
     * @param id
     * @return
     */
    MarketNairePoJo infonarire(String id) throws Exception;

    /****
     * 查询问题树
     * @return
     */
    List<MarketQuestionLibraryPojo> fullTreeLibaray() throws Exception;


    /***
     * 查询问券内容详细
     * @param narieCode
     * @param loadItem
     * @return
     */
    List<MarketQuestionnairePojo> fullTreeNarie(String narieCode, String companyId, Boolean loadItem) throws Exception;

    /***
     * 分页查询问券详细
     * @param page
     * @param limit
     * @param companyId
     * @param code
     * @param pId
     * @return
     */
    PageInfo pageNaireItem(int page, int limit, String companyId, String code, String pId);

    /**
     * 更新分值
     *
     * @param id
     * @param score
     */
    void updateNarireItemScore(String id, int score) throws Exception;

    /***
     * 校验分值
     * @param code
     * @return
     * @throws Exception
     */
    Integer checkScore(String code, String companyId) throws Exception;

    /***
     * 加载研问券
     * @param orderNum
     * @param companyId
     * @return
     */
    Integer loadQuestionOrder(String orderNum, String companyId) throws Exception;

    /***
     *
     * @param orderNum
     * @param companyId
     * @return
     */
    List<MarketTdcQuestionScorePojo> loadQuestionOrderTree(String orderNum, String companyId) throws Exception;

    /***
     * 任务处理-回答问题得分
     * @param id
     * @param score
     * @throws Exception
     */
    void updateOrderScore(String id, int score) throws Exception;
}
